import request from '@/utils/request'

// 查询笑话分类列表
export function listJokeCategory(query) {
  return request({
    url: '/earn/jokeCategory/list',
    method: 'get',
    params: query
  })
}
export function listJokeCategoryTree(query) {
  return request({
    url: '/earn/jokeCategory/listTree',
    method: 'get',
    params: query
  })
}

// 查询笑话分类详细
export function getJokeCategory(id) {
  return request({
    url: '/earn/jokeCategory/' + id,
    method: 'get'
  })
}

// 新增笑话分类
export function addJokeCategory(data) {
  return request({
    url: '/earn/jokeCategory',
    method: 'post',
    data: data
  })
}

// 修改笑话分类
export function updateJokeCategory(data) {
  return request({
    url: '/earn/jokeCategory',
    method: 'put',
    data: data
  })
}

// 删除笑话分类
export function delJokeCategory(id) {
  return request({
    url: '/earn/jokeCategory/' + id,
    method: 'delete'
  })
}
